package com.softeem.iov.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 管理员表
 * </p>
 *
 * @author softeem
 * @since 2023-09-19
 */
@Data
public class Admin implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 管理员id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空")
    private String username;

    /**
     * 登录密码（需要加密)
     */
    @NotBlank(message = "密码不能为空")
    @Size(min = 6,max = 18,message = "密码长度必须是{min}~{max}之间")
    private String password;

    /**
     * 头像地址
     */
    private String img;

    /**
     * 添加时间
     */
    private LocalDateTime regtime;

    /**
     * 用户状态 0-正常  1-禁用
     */
    @Range(min = 0,max = 1,message = "用户状态只能是0和1")
    private Integer status;

    /**
     * 随机盐-加密用
     */
    private String salt;

}
